﻿@model Telecom.Data.ONT_GPON

@{  AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "completedAjaxRequestAd_ONT_GPON"
    };
}

<script type="text/javascript">

    function opBeginProcess_loading_window_submit() {

        $("#ContentwindowFunction").mask("Dữ liệu đang xử lý");
    }

    function completedAjaxRequestAd_ONT_GPON(obj) {

        var returnObj = eval('(' + obj.responseText + ')');

        if (returnObj.Status == "success") {


            $('#listTbaleOnTGPON').jtable('load', { TbId: lapTbOntGponId_MAIN });

            close_window_elements('window_addupdate_ontGPON_MAIN');


        } else {

            $("#ContentwindowFunction").unmask();
            confirmOptionNormal(returnObj.Message);
        }

        return false;

    }

    $(document).ready(function () {

        $("#TRANGTHAI_UPONT_GPON").combobox({

            url: _nameSubDomain + '/TThietbi/ListTrangThaiJSOn',
            valueField: "Value",
            textField: "DisplayText",
            onSelect: function (row) {

                $("#TRANGTHAI_UPONTGPON").val(row.Value);

            },

        });


        $("#THIETBI_ONT_UPONT_GPON").combogrid({

            url: _nameSubDomain + "/Dm_ThietBi/ListThietBiInJson",
            panelWidth: 450,
            idField: 'ID',
            textField: 'TEN',
            fitcomlumm: true,
            columns: [[
                { field: 'MA', title: 'Mã TB', width: 90 },
                { field: 'TEN', title: 'Tên TB', width: 200 },
                {
                    field: 'LOAITB', title: 'Loại TB', width: 150, formatter: function (value, row) {
                        return get_loai_thietbi_byId(value).TEN;
                    },
                },
            ]],
            onSelect: function (index, row) {

                $("#THIETBI_ONT_UPONTGPON").val(row.ID);
                

            }

        });
        

    });

    

</script>

@using (Ajax.BeginForm("_UpdateONTGPON", "ONTGpon", null, ajaxOpts, new { enctype = "multipart/form-data" }))
{
    @Html.HiddenFor(model => model.ONTID)
    @Html.HiddenFor(model => model.SPLITTER16, new { id = "SPLITTER16_UPONTGPON" })
    @Html.HiddenFor(model => model.THUTU, new { id = "THUTU_UPONTGPON" })
    @Html.HiddenFor(model => model.VISA, new { id = "VISA_UPONTGPON" })
    @Html.HiddenFor(model => model.ONU_ID, new { id = "ONU_ID_UPONTGPON" })
    @Html.HiddenFor(model => model.TRANGTHAI, new { id = "TRANGTHAI_UPONTGPON" })
    @Html.HiddenFor(model => model.THIETBI_ONT, new { id = "THIETBI_ONT_UPONTGPON" })

    <div id="ContentwindowFunction" class="ContentwindowFunction">
        <table class="tableContentWindowFunction">
            
            
            <tr>
                <td>Serial
                </td>
                <td>
                    @Html.TextBoxFor(model => model.SERIAL, new { id="SERIAL", @class = "input_table_function maTable" })
                </td>
            </tr>
            <tr>
                <td>Account
                </td>
                <td>
                    @Html.TextBoxFor(model => model.ACCOUNT, new { id="ACCOUNT", @class = "input_table_function maTable" })
                </td>
            </tr>
            
            <tr>
                <td>Thiết bị ONT
                </td>
                <td>
                    <input class="easyui-combogrid" value="@Model.THIETBI_ONT" style="width:450px; height:27px" id="THIETBI_ONT_UPONT_GPON" name="THIETBI_ONT_UPONT_GPON">
                </td>
            </tr>
            <tr>
                <td>Trạng thái
                </td>
                <td>
                    <input class="easyui-combobox" value="@Model.TRANGTHAI" style="width:450px; height:27px" id="TRANGTHAI_UPONT_GPON" name="TRANGTHAI_UPONT_GPON">
                </td>
            </tr>
            <tr>
                <td>Ghi chú
                </td>
                <td>
                    @Html.TextAreaFor(model => model.GHI_CHU, new { @class = "input_table_function" })
                </td>
            </tr>
        </table>
        <div style="height: 20px"></div>
        <div class="footer_submit" style="margin-top: 0px; text-align: center">
            <button type="submit" onclick="return opBeginProcess_loading_window_submit(); ">
                <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">Cập nhật ONT GPON</span><span class="l-btn-icon icon-add">&nbsp;</span></span>
            </button>
            <button type="button" onclick="return close_window_elements('window_addupdate_ontGPON_MAIN');">
                <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">Hủy bỏ</span><span class="l-btn-icon icon-remove">&nbsp;</span></span></button>
        </div>
    </div>
    

}